<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>28comonent父子組件</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>

<body>
    <h1>28comonent component 父子组件</h1>
    <a href="../index.html">返回</a>
    <hr />
    <div id="app">

        <cat lyy-name="Tom"></cat>

    </div>
    <script type="text/javascript">
        var mousecomponent = {
            template: `
                <p>Json is running!</p>
            `
        }

        var catcomponent = {
            template: `<div style="border:solid 1px red">
                This cat name is {{lyyName}} !
                <mousecomponent></mousecomponent>
                </div>`,
            props: ['lyyName'],
            components: {
                'mousecomponent': mousecomponent
            }
        }

        var app = new Vue({
            el: "#app",
            data: {
                message: "最新公告:xxx"
            },
            components: {
                "cat": catcomponent
            }
        })
    </script>
</body>

</html>